package com.jugheadzhou.auth.service;

import com.jugheadzhou.auth.core.auth.LoginUser;
import com.jugheadzhou.auth.dto.LoginDto;
import com.jugheadzhou.auth.entity.User;

import java.math.BigDecimal;

/**
 * @author jugheadzhou
 * @date 2021-11-27
 */
public interface UserService {

    /**
     * 登陆
     *
     * @param loginDto
     * @return
     */
    LoginUser login(LoginDto loginDto);

    /**
     * 登出
     */
    void logout();

    /**
     * 查询用户信息
     *
     * @return
     */
    User info();

    /**
     * 更新分数
     *
     * @param username
     * @param score
     */
    void updateScore(String username, BigDecimal score);

    /**
     * 通过websocket连接ID查询分数
     *
     * @param connectionId
     * @return
     */
    String selectScoreByWsConnectionId(String connectionId);

    /**
     * 通过websocket连接ID查询初始分数并发送给消息队列
     *
     * @param connectionId
     * @return
     */
    void selectInitScoreAndSendMqByWsConnectionId(String connectionId);
}
